package mavenchild01;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.core.convert.converter.Converter;

/**
 *   @author:xiaojingjing
 *
 */

public class String2DateConverter implements Converter<String,Date>  {

	private final static String DATE_PATTERN ="yyyy-MM-dd HH:mm:ss";
	public Date convert(String source) {
		SimpleDateFormat sdf = new SimpleDateFormat(DATE_PATTERN);
		try {
			return (Date) sdf.parse(source);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
	
	public static void main(String args[]){
		System.out.println("test");
		
	}

	
	
}
